<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<%       
if(application.getAttribute("chat")!=null){
	if(request.getParameter("mywords")!=null){
	//将文本框"mywords"的值I LIKE CHAT赋给mywords
	String mywords = request.getParameter("mywords");
	//将chat属性值取出来拼接mywords的内容一起赋给mywords
	mywords = (String)application.getAttribute("chat") + "<br>" + mywords;
	application.setAttribute("chat", mywords); 
	out.print((String)application.getAttribute("chat"));
	}
}
else  {
    application.setAttribute("chat", "欢迎光临lili的聊天室");
    out.print((String)application.getAttribute("chat"));
    }
%>
<FORM ACTION="chat.jsp" METHOD="get">
    <INPUT TYPE="TEXT" SIZE="30" NAME="mywords" VALUE="I LIKE CHAT">
<INPUT TYPE="SUBMIT" name="submit" VALUE="提交">	
</FORM>
</body>
</html>